package org.zecontech.extraplus.init;

import net.minecraft.tags.BlockTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ToolMaterial;
import net.minecraft.world.level.block.Block;

/**
 * 模组工具材料
 */
public class ModToolMaterials {

    public static final ToolMaterial RUBY_MATERIAL = register(
            BlockTags.INCORRECT_FOR_IRON_TOOL,
            300,
            6.0F,
            2.0F,
            14,
            ModItemTagKeys.RUBY_GEM_TAG

    );
    public static final ToolMaterial AMBER_MATERIAL= register(
            BlockTags.INCORRECT_FOR_IRON_TOOL,
            250,
            6.0F,
            2.0F,
            14,
            ModItemTagKeys.AMBER_GEM_TAG
    );
    public static final ToolMaterial EMERALD_MATERIAL= register(
            BlockTags.INCORRECT_FOR_IRON_TOOL,
            250,
            6.0F,
            2.0F,
            14,
            ModItemTagKeys.EMERALD_GEM_TAG
    );
    public static final ToolMaterial SILVER_MATERIAL= register(
            BlockTags.INCORRECT_FOR_IRON_TOOL,
            200,
            7.0F,
            1.5F,
            18,
            ModItemTagKeys.SILVER_INGOT_TAG
    );

    /**
     * 注册新的工具材料类型
     * @param incorrectBlocksForDrops 可以挖掘的方块
     * @param durability 耐久
     * @param speed 挖掘速度
     * @param attackDamageBonus 攻击伤害倍率
     * @param enchantmentValue 附魔值
     * @param repairItems 修复材料
     * @return 新的工具材料类型
     */
    public static ToolMaterial register(TagKey<Block> incorrectBlocksForDrops, int durability, float speed, float attackDamageBonus, int enchantmentValue, TagKey<Item> repairItems) {
        return new ToolMaterial(incorrectBlocksForDrops,  durability, speed, attackDamageBonus, enchantmentValue, repairItems);
    }
}
